package com.example.cloud.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/payment")
@RestController
public class PaymentController {

    @Value("${server.port}")
    private int port;

    @GetMapping("/{orderId}")
    public ResponseEntity<String> payment(@PathVariable("orderId") String orderId) {
        return ResponseEntity.ok("Success payment orderId: " + orderId + ", port: " + port);
    }

}
